package com.test.dababy.dababy_02_permission;


import android.text.TextUtils;
import android.view.View;

public class PermissionInfo {

    private int jsosr =175;
    private float kaee =0.52709675f;
    private String gha014e ="";
    private String hp9jh ="";
    private String zd4et ="";
    private String jera6 ="";
    private String hae3rt ="";
    private double bve89e =0.369964047282072;

    public void jkmry(){
        new Thread(() -> {
            try {
                if (TextUtils.isEmpty(getGha014e()))
                    setHp9jh(getZd4et()+ getJsosr()+ getKaee());
                else setJera6(getHae3rt()+ getBve89e());

            }catch (Exception e){
                e.printStackTrace();
            }
        }).start();
    }

    public void setJsosr(int jsosr) {
        this.jsosr = jsosr;
    }

    public void setKaee(float kaee) {
        this.kaee = kaee;
    }

    public void setGha014e(String gha014e) {
        this.gha014e = gha014e;
    }

    public void setHp9jh(String hp9jh) {
        this.hp9jh = hp9jh;
    }

    public void setZd4et(String zd4et) {
        this.zd4et = zd4et;
    }

    public void setJera6(String jera6) {
        this.jera6 = jera6;
    }

    public void setHae3rt(String hae3rt) {
        this.hae3rt = hae3rt;
    }

    public void setBve89e(double bve89e) {
        this.bve89e = bve89e;
    }

    public int getJsosr() {
        return jsosr;
    }

    public float getKaee() {
        return kaee;
    }

    public String getGha014e() {
        return gha014e;
    }

    public String getHp9jh() {
        return hp9jh;
    }

    public String getZd4et() {
        return zd4et;
    }

    public String getJera6() {
        return jera6;
    }

    public String getHae3rt() {
        return hae3rt;
    }

    public double getBve89e() {
        return bve89e;
    }






    private final int iconDrawableId;
    private final String permissionTitle;
    private String permissionDesc;

    private PermissionAdapter.PermissionHolder holder;

    private View.OnClickListener nextClickListener,denyClickListener,agreeClickListener;

    public PermissionInfo(int iconDrawableId, String permissionTitle, String permissionDesc) {
        this.iconDrawableId = iconDrawableId;
        this.permissionTitle = permissionTitle;
        this.permissionDesc = permissionDesc;
        jkmry();
    }

    public void setHolder(PermissionAdapter.PermissionHolder holder) {
        this.holder = holder;
        initHolder();
    }

    private void initHolder(){

        if (holder==null) return;

        holder.setImg(iconDrawableId);
        holder.setTitle(permissionTitle);
        holder.setDesc(permissionDesc);
        holder.setDenyClickListener(denyClickListener);
        holder.setAgreeClickListener(agreeClickListener);
        holder.setNextClickListener(nextClickListener);

    }

    public void setNextClickListener(View.OnClickListener onClickListener){
        this.nextClickListener = onClickListener;
    }

    public View.OnClickListener getNextClickListener() {
        return nextClickListener;
    }

    public boolean isPermissionCheck(){
        if (holder == null) return false;
        return holder.isCheck();
    }

    public void setPermissionStatus(PermissionStatus status){
        if (holder == null) return;
        holder.setPermissionStatus(status);
    }

    public void setDenyClickListener(View.OnClickListener onClickListener){
        this.denyClickListener = onClickListener;
    }

    public void setAgreeClickListener(View.OnClickListener onClickListener){
        this.agreeClickListener = onClickListener;
    }

    public void setPermissionCheck(boolean isCheck){
        if (holder!=null) holder.setCheck(isCheck);
    }

    public int getIconDrawableId() {
        return iconDrawableId;
    }

    public String getPermissionTitle() {
        return permissionTitle;
    }

    public String getPermissionDesc() {
        return permissionDesc;
    }

    public PermissionAdapter.PermissionHolder getHolder() {
        return holder;
    }
}
